<template>
  <div>
    <el-row>
    <el-empty description="加载中..." v-if="empty"></el-empty>
      <el-col :md="12" class="couponStyle" v-for="item in couponsList" :key="item.cid">
        <div class="stamp stamp02">
          <div class="par">
            <p>{{item.cname}}</p>
            <!-- <sub class="sign">￥</sub><span>50.00</span><sub>优惠券</sub> -->
            <p>{{item.cabout}}</p>
            <p>{{item.state == 0 ? "未使用" : "已使用"}}</p>
          </div>
          <div class="copy">
            副券
            <p>{{
              item.preferenceType == 0 ? "折扣券" : "立减券"
              }}</p>
          </div>
          <i></i>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      couponsList:[],
      empty:true,
    };
  },
  mounted() {
    this.getcoupList();
  },
  methods: {
    getcoupList() {
      this.$http.get(this.baseURL + '/coupon/findByUID',{
        params: {
            id: JSON.parse(sessionStorage.getItem("userinfo")).uid,
          },
      }).then(res => {
        console.log(res.data)
        this.couponsList = res.data.data;
        this.empty = false;
      })
    },
  },
};
</script>

<style scoped lang="less">
.couponStyle {
  margin-bottom: 30px;
}
.stamp * {
  padding: 0;
  margin: 0;
  list-style: none;
  font-family: "Microsoft YaHei", "Source Code Pro", Menlo, Consolas, Monaco,
    monospace;
}
.stamp {
  width: 387px;
  height: 100px;
  padding: 0 10px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}
.stamp:before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  right: 10px;
  z-index: -1;
}
.stamp i {
  position: absolute;
  left: 20%;
  top: 45px;
  height: 190px;
  width: 390px;
  background-color: rgba(255, 255, 255, 0.15);
  transform: rotate(-30deg);
}
.stamp .par {
  float: left;
  padding: 16px 15px;
  width: 220px;
  border-right: 2px dashed rgba(255, 255, 255, 0.3);
  text-align: left;
}
.stamp .par p {
  color: #fff;
  font-size: 13px;
  line-height: 25px;
}
.stamp .par span {
  font-size: 50px;
  color: #fff;
  margin-right: 5px;
  line-height: 65px;
}
.stamp .par .sign {
  font-size: 34px;
}
.stamp .par sub {
  position: relative;
  top: -5px;
  color: rgba(255, 255, 255, 0.8);
}
.stamp .copy {
  display: inline-block;
  padding: 21px 14px;
  width: 100px;
  vertical-align: text-bottom;
  font-size: 30px;
  color: rgb(255, 255, 255);
  text-align: center;
  line-height: initial;
}
.stamp .copy p {
  font-size: 16px;
  margin-top: 5px;
}
.stamp02 {
  background: radial-gradient(transparent 0, transparent 5px, #d24161 5px);
  background-size: 15px 15px;
  background-position: 9px 3px;
}
.stamp02:before {
  background-color: #d24161;
}
</style>